package com.xs.controller;

import com.xs.common.JsonResult;
import com.xs.service.FtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ftype")
public class FtypeController {

    @Autowired
    private FtypeService ftypeService;

    //查询所有
    @GetMapping
    public JsonResult<?> getAll(){
        return JsonResult.success(ftypeService.list());
    }

    //根据ID查询
    @GetMapping("/{tid}")
    public JsonResult<?> getBytid(@PathVariable Integer tid){
        return JsonResult.success(ftypeService.getById(tid));
    }

}
